#include<iostream>
using namespace std;
const int UPT = 6, DPT = 4, STT = 5;
int main(int argc, char const *argv[])
{
    // freopen("test.txt","r",stdin);
    int N; cin>>N;
    int h = 0;
    int res = STT * N;
    for(int i = 0;i<N;++i)
    {
        int tmp;cin>>tmp;
        if(tmp>h) res += UPT*(tmp-h);
        else if(tmp<h) res += DPT*(h-tmp);
        h = tmp;
    }
    cout<<res;

    return 0;
}
